#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <assert.h>

int main()
{
	printf("one process, pid: %d, ppid: %d.\n",getpid(),getppid());
	pid_t id = fork();
	sleep(3);
	int cnt = 5;
	while(cnt--)
	{
		if (id){
			printf("father process, pid: %d, ppid: %d.\n",getpid(),getppid());
		}
		else if (id == 0){
			printf("child process, pid: %d, ppid: %d.\n",getpid(),getppid());
		}
		else	assert(0);
		sleep(1);
	}
	return 0;
}
